package com.ruoyi.order.service.impl;

import java.util.List;

import com.ruoyi.art.domain.ArtGood;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.OrderItemsMapper;
import com.ruoyi.order.domain.OrderItems;
import com.ruoyi.order.service.IOrderItemsService;

/**
 * 订单商品明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-09
 */
@Service
public class OrderItemsServiceImpl implements IOrderItemsService 
{
    @Autowired
    private OrderItemsMapper orderItemsMapper;

    /**
     * 查询订单商品明细
     * 
     * @param orderItemId 订单商品明细主键
     * @return 订单商品明细
     */
    @Override
    public OrderItems selectOrderItemsByOrderItemId(Integer orderItemId)
    {
        return orderItemsMapper.selectOrderItemsByOrderItemId(orderItemId);
    }

    /**
     * 查询订单商品明细列表
     * 
     * @param orderItems 订单商品明细
     * @return 订单商品明细
     */
    @Override
    public List<OrderItems> selectOrderItemsList(OrderItems orderItems)
    {
        return orderItemsMapper.selectOrderItemsList(orderItems);
    }

    /**
     * 新增订单商品明细
     * 
     * @param orderItems 订单商品明细
     * @return 结果
     */
    @Override
    public int insertOrderItems(OrderItems orderItems)
    {
        return orderItemsMapper.insertOrderItems(orderItems);
    }

    /**
     * 修改订单商品明细
     * 
     * @param orderItems 订单商品明细
     * @return 结果
     */
    @Override
    public int updateOrderItems(OrderItems orderItems)
    {
        return orderItemsMapper.updateOrderItems(orderItems);
    }

    /**
     * 批量删除订单商品明细
     * 
     * @param orderItemIds 需要删除的订单商品明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsByOrderItemIds(Integer[] orderItemIds)
    {
        return orderItemsMapper.deleteOrderItemsByOrderItemIds(orderItemIds);
    }

    /**
     * 删除订单商品明细信息
     * 
     * @param orderItemId 订单商品明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsByOrderItemId(Integer orderItemId)
    {
        return orderItemsMapper.deleteOrderItemsByOrderItemId(orderItemId);
    }

    @Override
    public ArtGood selectArtGoodByGoodId(Integer goodId) {
        return orderItemsMapper.selectArtGoodByGoodId(goodId);
    }

}
